<div>
    <div>
        <div style="float: right;">
            <form class="form-inline" name="myForm" novalidate>
                <div class="form-group" ng-init="username=''">
                    <input type="text" class="form-control" ng-model="username"  placeholder="用户登录名" required>
                </div>

                <div class="form-group" ng-init="role= [ { id: 1, name: '研发角色'} , { id: 2, name: '运维角色'} , { id: 3, name: '管理员'} ]">
                    <select class="form-control"  ng-model="connectoruserauth.role"  ng-options="o.id as o.name for o in role"  > </select>
                </div>

                <button type="submit" ng-disabled="myForm.$invalid" class="btn btn-primary" ng-click="connectoruserauth.addAuth()"><i class="fa fa-user-secret fa-lg" aria-hidden="true"></i>添加权限</button>
            </form>
        </div>
        <div style="clear: both;">&nbsp;</div>
    </div>

    <div class="panel panel-primary">
        <div class="panel-heading">
            <span class="panel-controls">
                <button class="btn btn-primary" uib-tooltip="刷新" ng-click="connectoruserauth.reload()" ><i class="fa fa-refresh fa-fw" ng-class="{'fa-spin':!connectoruserauth.loadover}" ></i></button>
            </span>
            <h5>用户权限</h5>
        </div>

        <div class="panel-body">
            <div class="panel-tabs">
                <table ng-table="connectoruserauth.userTable" class="table table-hover text-center table-condensed" show-filter="true">
                    <tr ng-repeat="user in $data">
                        <td style="width: 10%" data-title="'用户'" filter="{ name: 'text'}" sortable="'name'">{{user.name}}</td>
                        <td style="width: 10%" data-title="'级别'" sortable="'level'">
                            <a ng-if="user.level==1" > 研发 </a>
                            <a ng-if="user.level==2" style="color: #e52" > 运维 </a>
                            <a ng-if="user.level==3" style="color: red" > 管理员 </a>
                        </td>
                        <td style="width: 10%" data-title="'操作'">
                            <button class="btn btn-primary btn-md" ng-click="connectoruserauth.delete(user.name)">删除</button>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>

